package online.takemehand.fx;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class Main extends Application {


    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("认识stage窗口");
        primaryStage.getIcons().add(new Image("/仓库清单.png"));
        //设置最大化
//        primaryStage.setMaximized(true);
        //设置最小化
//        primaryStage.setIconified(true);
        //关闭窗口
//        primaryStage.close();
//        primaryStage.setWidth(1920);
//        primaryStage.setHeight(1080);
//        primaryStage.setMaxWidth(2000);
//        primaryStage.setHeight(500);

        primaryStage.show();
        System.out.println(primaryStage.getWidth());
        System.out.println(primaryStage.getHeight());
        //监听高度
        primaryStage.heightProperty().addListener((ov, oldValue, newValue) -> {
            System.out.println(newValue);
        });
        //监听宽度
        primaryStage.widthProperty().addListener((ov, oldValue, newValue) -> {
            System.out.println(newValue);
        });
        //设置全屏
        primaryStage.setScene(new Scene(new Group()));
        primaryStage.setFullScreen(true);
    }
}
